#include <iostream>
#include <future>
#include <thread>

int Add(int num1, int num2)
{
    std::cout << "add" << std::endl;
    return num1 + num2;
}

int main()
{
    std::promise<int> pro;
    std::future<int> res = pro.get_future();
    std::thread thr([&pro](){
        int ret = Add(11, 22);
        pro.set_value(ret);
    });
    std::cout << res.get() << std::endl;
    thr.join();
    return 0;
}